using System.Collections;
using System.IO;
using Commons.Parser;

namespace Commons.Models.Settings.Parsers
{
	public abstract class BaseSettingsParser<T> : BaseXmlParser<T>, ISettingsParser
	{
		public int NumObjects { get; protected set; }
		public int TotalObjects { get; protected set; }

		protected string path;

		public BaseSettingsParser(string path)
		{
			this.path = path;
		}

		public void Load()
		{
			string filename = Path.GetFileName(path) + ".xml";
			string filePath = Path.Combine(GameSettings.SettingsPath, filename);

            if (File.Exists(filePath))
            {
                LoadFromFileSystem(filePath);
            }
            else
            {

            }
		}

		public abstract IEnumerator Parse(ParserContext context, ISettingsModel settingsModel);
	}
}

